        <!DOCTYPE html>
        <html>
        <head>
                <meta charset="utf-8">
        <title>mat3 class / vector_math Library / Dart Documentation</title>
        <link rel="stylesheet" type="text/css"
            href="../styles.css">
        <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
        <link rel="shortcut icon" href="../favicon.ico">
        
        </head>
        <body data-library="vector_math" data-type="mat3">
        <div class="page">
        <div class="header">
          <a href="../index.html"><div class="logo"></div></a>
          <a href="../index.html">Dart Documentation</a>
         &rsaquo; <a href="../vector_math.html">vector_math</a> &rsaquo; <a href="../vector_math/mat3.html">mat3</a>        <div id="search-box">
          <input type="search" name="q" id="q" autocomplete="off"
              class="search-input" placeholder="Search API">
        </div>
        
      </div>
      <div class="drop-down" id="drop-down"></div>
      
        <div class="nav">
        
</div>
<div class="content">
        <h2><strong>mat3</strong>
          class
        </h2>
        
<button id="show-inherited" class="show-inherited">Hide inherited</button>
<div class="doc">
<p>mat3 is a column major matrix where each column is represented by <a class="crossref" href="../vector_math/vec3.html">vec3</a>. This matrix has 3 columns and 3 rows.</p>
<pre class="source">
class mat3 {
 vec3 col0;
 vec3 col1;
 vec3 col2;
 /// Constructs a new mat3. Supports GLSL like syntax so many possible inputs. Defaults to identity matrix.
 mat3([dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5, dynamic arg6, dynamic arg7, dynamic arg8]) {
   //Initialize the matrix as the identity matrix
   col0 = new vec3.zero();
   col1 = new vec3.zero();
   col2 = new vec3.zero();
   col0.x = 1.0;
   col1.y = 1.0;
   col2.z = 1.0;
   if (arg0 is num &amp;&amp; arg1 is num &amp;&amp; arg2 is num &amp;&amp; arg3 is num &amp;&amp; arg4 is num &amp;&amp; arg5 is num &amp;&amp; arg6 is num &amp;&amp; arg7 is num &amp;&amp; arg8 is num) {
     col0.x = arg0;
     col0.y = arg1;
     col0.z = arg2;
     col1.x = arg3;
     col1.y = arg4;
     col1.z = arg5;
     col2.x = arg6;
     col2.y = arg7;
     col2.z = arg8;
     return;
   }
   if (arg0 is num &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null &amp;&amp; arg4 == null &amp;&amp; arg5 == null &amp;&amp; arg6 == null &amp;&amp; arg7 == null &amp;&amp; arg8 == null) {
     col0.x = arg0;
     col1.y = arg0;
     col2.z = arg0;
     return;
   }
   if (arg0 is vec3 &amp;&amp; arg1 is vec3 &amp;&amp; arg2 is vec3) {
     col0 = arg0;
     col1 = arg1;
     col2 = arg2;
     return;
   }
   if (arg0 is mat3) {
     col0 = arg0.col0;
     col1 = arg0.col1;
     col2 = arg0.col2;
     return;
   }
   if (arg0 is mat2) {
     col0.x = arg0.col0.x;
     col0.y = arg0.col0.y;
     col1.x = arg0.col1.x;
     col1.y = arg0.col1.y;
     return;
   }
   if (arg0 is vec2 &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null &amp;&amp; arg4 == null &amp;&amp; arg5 == null &amp;&amp; arg6 == null &amp;&amp; arg7 == null &amp;&amp; arg8 == null) {
     col0.x = arg0.x;
     col1.y = arg0.y;
   }
   if (arg0 is vec3 &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null &amp;&amp; arg4 == null &amp;&amp; arg5 == null &amp;&amp; arg6 == null &amp;&amp; arg7 == null &amp;&amp; arg8 == null) {
     col0.x = arg0.x;
     col1.y = arg0.y;
     col2.z = arg0.z;
   }
 }
 /// Constructs a new [mat3] from computing the outer product of [u] and [v].
 mat3.outer(vec3 u, vec3 v) {
   col0 = new vec3.zero();
   col1 = new vec3.zero();
   col2 = new vec3.zero();
   col0.x = u.x * v.x;
   col0.y = u.x * v.y;
   col0.z = u.x * v.z;
   col1.x = u.y * v.x;
   col1.y = u.y * v.y;
   col1.z = u.y * v.z;
   col2.x = u.z * v.x;
   col2.y = u.z * v.y;
   col2.z = u.z * v.z;
 }
 /// Constructs a new [mat3] filled with zeros.
 mat3.zero() {
   col0 = new vec3.zero();
   col1 = new vec3.zero();
   col2 = new vec3.zero();
   col0.x = 0.0;
   col0.y = 0.0;
   col0.z = 0.0;
   col1.x = 0.0;
   col1.y = 0.0;
   col1.z = 0.0;
   col2.x = 0.0;
   col2.y = 0.0;
   col2.z = 0.0;
 }
 /// Constructs a new identity [mat3].
 mat3.identity() {
   col0 = new vec3.zero();
   col1 = new vec3.zero();
   col2 = new vec3.zero();
   col0.x = 1.0;
   col1.y = 1.0;
   col2.z = 1.0;
 }
 /// Constructs a new [mat3] which is a copy of [other].
 mat3.copy(mat3 other) {
   col0 = new vec3.zero();
   col1 = new vec3.zero();
   col2 = new vec3.zero();
   col0.x = other.col0.x;
   col0.y = other.col0.y;
   col0.z = other.col0.z;
   col1.x = other.col1.x;
   col1.y = other.col1.y;
   col1.z = other.col1.z;
   col2.x = other.col2.x;
   col2.y = other.col2.y;
   col2.z = other.col2.z;
 }
 //// Constructs a new [mat3] representation a rotation of [radians] around the X axis
 mat3.rotationX(num radians_) {
   col0 = new vec3.zero();
   col1 = new vec3.zero();
   col2 = new vec3.zero();
   setRotationX(radians_);
 }
 //// Constructs a new [mat3] representation a rotation of [radians] around the Y axis
 mat3.rotationY(num radians_) {
   col0 = new vec3.zero();
   col1 = new vec3.zero();
   col2 = new vec3.zero();
   setRotationY(radians_);
 }
 //// Constructs a new [mat3] representation a rotation of [radians] around the Z axis
 mat3.rotationZ(num radians_) {
   col0 = new vec3.zero();
   col1 = new vec3.zero();
   col2 = new vec3.zero();
   setRotationZ(radians_);
 }
 mat3.raw(num arg0, num arg1, num arg2, num arg3, num arg4, num arg5, num arg6, num arg7, num arg8) {
   col0 = new vec3.zero();
   col1 = new vec3.zero();
   col2 = new vec3.zero();
   col0.x = arg0;
   col0.y = arg1;
   col0.z = arg2;
   col1.x = arg3;
   col1.y = arg4;
   col1.z = arg5;
   col2.x = arg6;
   col2.y = arg7;
   col2.z = arg8;
 }
 /// Returns a printable string
 String toString() {
   String s = '';
   s = '$s[0] ${getRow(0)}\n';
   s = '$s[1] ${getRow(1)}\n';
   s = '$s[2] ${getRow(2)}\n';
   return s;
 }
 /// Returns the number of rows in the matrix.
 int get rows =&gt; 3;
 /// Returns the number of columns in the matrix.
 int get cols =&gt; 3;
 /// Returns the number of columns in the matrix.
 int get length =&gt; 3;
 /// Gets the [column] of the matrix
 vec3 operator[](int column) {
   assert(column &gt;= 0 &amp;&amp; column &lt; 3);
   switch (column) {
     case 0: return col0;
     case 1: return col1;
     case 2: return col2;
   }
   throw new ArgumentError(column);
 }
 /// Assigns the [column] of the matrix [arg]
 void operator[]=(int column, vec3 arg) {
   assert(column &gt;= 0 &amp;&amp; column &lt; 3);
   switch (column) {
     case 0: col0 = arg; break;
     case 1: col1 = arg; break;
     case 2: col2 = arg; break;
   }
   throw new ArgumentError(column);
 }
 /// Returns row 0
 vec3 get row0 =&gt; getRow(0);
 /// Returns row 1
 vec3 get row1 =&gt; getRow(1);
 /// Returns row 2
 vec3 get row2 =&gt; getRow(2);
 /// Sets row 0 to [arg]
 set row0(vec3 arg) =&gt; setRow(0, arg);
 /// Sets row 1 to [arg]
 set row1(vec3 arg) =&gt; setRow(1, arg);
 /// Sets row 2 to [arg]
 set row2(vec3 arg) =&gt; setRow(2, arg);
 /// Assigns the [column] of the matrix [arg]
 void setRow(int row, vec3 arg) {
   assert(row &gt;= 0 &amp;&amp; row &lt; 3);
   col0[row] = arg.x;
   col1[row] = arg.y;
   col2[row] = arg.z;
 }
 /// Gets the [row] of the matrix
 vec3 getRow(int row) {
   assert(row &gt;= 0 &amp;&amp; row &lt; 3);
   vec3 r = new vec3.zero();
   r.x = col0[row];
   r.y = col1[row];
   r.z = col2[row];
   return r;
 }
 /// Assigns the [column] of the matrix [arg]
 void setColumn(int column, vec3 arg) {
   assert(column &gt;= 0 &amp;&amp; column &lt; 3);
   this[column] = arg;
 }
 /// Gets the [column] of the matrix
 vec3 getColumn(int column) {
   assert(column &gt;= 0 &amp;&amp; column &lt; 3);
   return new vec3.copy(this[column]);
 }
 /// Returns a new vector or matrix by multiplying [this] with [arg].
 dynamic operator*(dynamic arg) {
   if (arg is num) {
     mat3 r = new mat3.zero();
     r.col0.x = col0.x * arg;
     r.col0.y = col0.y * arg;
     r.col0.z = col0.z * arg;
     r.col1.x = col1.x * arg;
     r.col1.y = col1.y * arg;
     r.col1.z = col1.z * arg;
     r.col2.x = col2.x * arg;
     r.col2.y = col2.y * arg;
     r.col2.z = col2.z * arg;
     return r;
   }
   if (arg is vec3) {
     vec3 r = new vec3.zero();
     r.x =  (this.col0.x * arg.x) + (this.col1.x * arg.y) + (this.col2.x * arg.z);
     r.y =  (this.col0.y * arg.x) + (this.col1.y * arg.y) + (this.col2.y * arg.z);
     r.z =  (this.col0.z * arg.x) + (this.col1.z * arg.y) + (this.col2.z * arg.z);
     return r;
   }
   if (3 == arg.rows) {
     dynamic r = null;
     if (arg.cols == 3) {
       r = new mat3.zero();
       r.col0.x =  (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y) + (this.col2.x * arg.col0.z);
       r.col1.x =  (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y) + (this.col2.x * arg.col1.z);
       r.col2.x =  (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y) + (this.col2.x * arg.col2.z);
       r.col0.y =  (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y) + (this.col2.y * arg.col0.z);
       r.col1.y =  (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z);
       r.col2.y =  (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y) + (this.col2.y * arg.col2.z);
       r.col0.z =  (this.col0.z * arg.col0.x) + (this.col1.z * arg.col0.y) + (this.col2.z * arg.col0.z);
       r.col1.z =  (this.col0.z * arg.col1.x) + (this.col1.z * arg.col1.y) + (this.col2.z * arg.col1.z);
       r.col2.z =  (this.col0.z * arg.col2.x) + (this.col1.z * arg.col2.y) + (this.col2.z * arg.col2.z);
       return r;
     }
     return r;
   }
   throw new ArgumentError(arg);
 }
 /// Returns new matrix after component wise [this] + [arg]
 mat3 operator+(mat3 arg) {
   mat3 r = new mat3.zero();
   r.col0.x = col0.x + arg.col0.x;
   r.col0.y = col0.y + arg.col0.y;
   r.col0.z = col0.z + arg.col0.z;
   r.col1.x = col1.x + arg.col1.x;
   r.col1.y = col1.y + arg.col1.y;
   r.col1.z = col1.z + arg.col1.z;
   r.col2.x = col2.x + arg.col2.x;
   r.col2.y = col2.y + arg.col2.y;
   r.col2.z = col2.z + arg.col2.z;
   return r;
 }
 /// Returns new matrix after component wise [this] - [arg]
 mat3 operator-(mat3 arg) {
   mat3 r = new mat3.zero();
   r.col0.x = col0.x - arg.col0.x;
   r.col0.y = col0.y - arg.col0.y;
   r.col0.z = col0.z - arg.col0.z;
   r.col1.x = col1.x - arg.col1.x;
   r.col1.y = col1.y - arg.col1.y;
   r.col1.z = col1.z - arg.col1.z;
   r.col2.x = col2.x - arg.col2.x;
   r.col2.y = col2.y - arg.col2.y;
   r.col2.z = col2.z - arg.col2.z;
   return r;
 }
 /// Returns new matrix -this
 mat3 operator-() {
   mat3 r = new mat3.zero();
   r[0] = -this[0];
   r[1] = -this[1];
   r[2] = -this[2];
   return r;
 }
 /// Zeros [this].
 mat3 setZero() {
   col0.x = 0.0;
   col0.y = 0.0;
   col0.z = 0.0;
   col1.x = 0.0;
   col1.y = 0.0;
   col1.z = 0.0;
   col2.x = 0.0;
   col2.y = 0.0;
   col2.z = 0.0;
   return this;
 }
 /// Makes [this] into the identity matrix.
 mat3 setIdentity() {
   col0.x = 1.0;
   col0.y = 0.0;
   col0.z = 0.0;
   col1.x = 0.0;
   col1.y = 1.0;
   col1.z = 0.0;
   col2.x = 0.0;
   col2.y = 0.0;
   col2.z = 1.0;
   return this;
 }
 /// Returns the tranpose of this.
 mat3 transposed() {
   mat3 r = new mat3.zero();
   r.col0.x = col0.x;
   r.col0.y = col1.x;
   r.col0.z = col2.x;
   r.col1.x = col0.y;
   r.col1.y = col1.y;
   r.col1.z = col2.y;
   r.col2.x = col0.z;
   r.col2.y = col1.z;
   r.col2.z = col2.z;
   return r;
 }
 mat3 transpose() {
   double temp;
   temp = col1.x;
   col1.x = col0.y;
   col0.y = temp;
   temp = col2.x;
   col2.x = col0.z;
   col0.z = temp;
   temp = col2.y;
   col2.y = col1.z;
   col1.z = temp;
   return this;
 }
 /// Returns the component wise absolute value of this.
 mat3 absolute() {
   mat3 r = new mat3.zero();
   r.col0.x = col0.x.abs();
   r.col0.y = col0.y.abs();
   r.col0.z = col0.z.abs();
   r.col1.x = col1.x.abs();
   r.col1.y = col1.y.abs();
   r.col1.z = col1.z.abs();
   r.col2.x = col2.x.abs();
   r.col2.y = col2.y.abs();
   r.col2.z = col2.z.abs();
   return r;
 }
 /// Returns the determinant of this matrix.
 double determinant() {
   double x = col0.x*((col1.y*col2.z)-(col1.z*col2.y));
   double y = col0.y*((col1.x*col2.z)-(col1.z*col2.x));
   double z = col0.z*((col1.x*col2.y)-(col1.y*col2.x));
   return x - y + z;
 }
 /// Returns the trace of the matrix. The trace of a matrix is the sum of the diagonal entries
 double trace() {
   double t = 0.0;
   t += col0.x;
   t += col1.y;
   t += col2.z;
   return t;
 }
 /// Returns infinity norm of the matrix. Used for numerical analysis.
 double infinityNorm() {
   double norm = 0.0;
   {
     double row_norm = 0.0;
     row_norm += this[0][0].abs();
     row_norm += this[0][1].abs();
     row_norm += this[0][2].abs();
     norm = row_norm &gt; norm ? row_norm : norm;
   }
   {
     double row_norm = 0.0;
     row_norm += this[1][0].abs();
     row_norm += this[1][1].abs();
     row_norm += this[1][2].abs();
     norm = row_norm &gt; norm ? row_norm : norm;
   }
   {
     double row_norm = 0.0;
     row_norm += this[2][0].abs();
     row_norm += this[2][1].abs();
     row_norm += this[2][2].abs();
     norm = row_norm &gt; norm ? row_norm : norm;
   }
   return norm;
 }
 /// Returns relative error between [this] and [correct]
 double relativeError(mat3 correct) {
   mat3 diff = correct - this;
   double correct_norm = correct.infinityNorm();
   double diff_norm = diff.infinityNorm();
   return diff_norm/correct_norm;
 }
 /// Returns absolute error between [this] and [correct]
 double absoluteError(mat3 correct) {
   double this_norm = infinityNorm();
   double correct_norm = correct.infinityNorm();
   double diff_norm = (this_norm - correct_norm).abs();
   return diff_norm;
 }
 /// Invert the matrix. Returns the determinant.
 double invert() {
   double det = determinant();
   if (det == 0.0) {
     return 0.0;
   }
   double invDet = 1.0 / det;
   vec3 i = new vec3.zero();
   vec3 j = new vec3.zero();
   vec3 k = new vec3.zero();
   i.x = invDet * (col1.y * col2.z - col1.z * col2.y);
   i.y = invDet * (col0.z * col2.y - col0.y * col2.z);
   i.z = invDet * (col0.y * col1.z - col0.z * col1.y);
   j.x = invDet * (col1.z * col2.x - col1.x * col2.z);
   j.y = invDet * (col0.x * col2.z - col0.z * col2.x);
   j.z = invDet * (col0.z * col1.x - col0.x * col1.z);
   k.x = invDet * (col1.x * col2.y - col1.y * col2.x);
   k.y = invDet * (col0.y * col2.x - col0.x * col2.y);
   k.z = invDet * (col0.x * col1.y - col0.y * col1.x);
   col0 = i;
   col1 = j;
   col2 = k;
   return det;
 }
 /// Turns the matrix into a rotation of [radians] around X
 void setRotationX(num radians) {
   double radians_ = radians.toDouble();
   double c = Math.cos(radians_);
   double s = Math.sin(radians_);
   col0.x = 1.0;
   col0.y = 0.0;
   col0.z = 0.0;
   col1.x = 0.0;
   col1.y = c;
   col1.z = s;
   col2.x = 0.0;
   col2.y = -s;
   col2.z = c;
 }
 /// Turns the matrix into a rotation of [radians] around Y
 void setRotationY(num radians) {
   double radians_ = radians.toDouble();
   double c = Math.cos(radians_);
   double s = Math.sin(radians_);
   col0.x = c;
   col0.y = 0.0;
   col0.z = s;
   col1.x = 0.0;
   col1.y = 1.0;
   col1.z = 0.0;
   col2.x = -s;
   col2.y = 0.0;
   col2.z = c;
 }
 /// Turns the matrix into a rotation of [radians] around Z
 void setRotationZ(num radians) {
   double radians_ = radians.toDouble();
   double c = Math.cos(radians_);
   double s = Math.sin(radians_);
   col0.x = c;
   col0.y = s;
   col0.z = 0.0;
   col1.x = -s;
   col1.y = c;
   col1.z = 0.0;
   col2.x = 0.0;
   col2.y = 0.0;
   col2.z = 1.0;
 }
 /// Converts into Adjugate matrix and scales by [scale]
 mat3 scaleAdjoint(num scale) {
   double scale_ = scale.toDouble();
   double m00 = col0.x;
   double m01 = col1.x;
   double m02 = col2.x;
   double m10 = col0.y;
   double m11 = col1.y;
   double m12 = col2.y;
   double m20 = col0.z;
   double m21 = col1.z;
   double m22 = col2.z;
   col0.x = (m11 * m22 - m12 * m21) * scale_;
   col0.y = (m12 * m20 - m10 * m22) * scale_;
   col0.z = (m10 * m21 - m11 * m20) * scale_;
   col1.x = (m02 * m21 - m01 * m22) * scale_;
   col1.y = (m00 * m22 - m02 * m20) * scale_;
   col1.z = (m01 * m20 - m00 * m21) * scale_;
   col2.x = (m01 * m12 - m02 * m11) * scale_;
   col2.y = (m02 * m10 - m00 * m12) * scale_;
   col2.z = (m00 * m11 - m01 * m10) * scale_;
   return this;
 }
 /// Rotates [arg] by the absolute rotation of [this]
 /// Returns [arg].
 /// Primarily used by AABB transformation code.
 vec3 absoluteRotate(vec3 arg) {
   double m00 = col0.x.abs();
   double m01 = col1.x.abs();
   double m02 = col2.x.abs();
   double m10 = col0.y.abs();
   double m11 = col1.y.abs();
   double m12 = col2.y.abs();
   double m20 = col0.z.abs();
   double m21 = col1.z.abs();
   double m22 = col2.z.abs();
   double x = arg.x;
   double y = arg.y;
   double z = arg.z;
   arg.x = x * m00 + y * m01 + z * m02 + 0.0 * 0.0;
   arg.y = x * m10 + y * m11 + z * m12 + 0.0 * 0.0;
   arg.z = x * m20 + y * m21 + z * m22 + 0.0 * 0.0;
   return arg;
 }
 mat3 clone() {
   return new mat3.copy(this);
 }
 mat3 copyInto(mat3 arg) {
   arg.col0.x = col0.x;
   arg.col0.y = col0.y;
   arg.col0.z = col0.z;
   arg.col1.x = col1.x;
   arg.col1.y = col1.y;
   arg.col1.z = col1.z;
   arg.col2.x = col2.x;
   arg.col2.y = col2.y;
   arg.col2.z = col2.z;
   return arg;
 }
 mat3 copyFrom(mat3 arg) {
   col0.x = arg.col0.x;
   col0.y = arg.col0.y;
   col0.z = arg.col0.z;
   col1.x = arg.col1.x;
   col1.y = arg.col1.y;
   col1.z = arg.col1.z;
   col2.x = arg.col2.x;
   col2.y = arg.col2.y;
   col2.z = arg.col2.z;
   return this;
 }
 mat3 add(mat3 o) {
   col0.x = col0.x + o.col0.x;
   col0.y = col0.y + o.col0.y;
   col0.z = col0.z + o.col0.z;
   col1.x = col1.x + o.col1.x;
   col1.y = col1.y + o.col1.y;
   col1.z = col1.z + o.col1.z;
   col2.x = col2.x + o.col2.x;
   col2.y = col2.y + o.col2.y;
   col2.z = col2.z + o.col2.z;
   return this;
 }
 mat3 sub(mat3 o) {
   col0.x = col0.x - o.col0.x;
   col0.y = col0.y - o.col0.y;
   col0.z = col0.z - o.col0.z;
   col1.x = col1.x - o.col1.x;
   col1.y = col1.y - o.col1.y;
   col1.z = col1.z - o.col1.z;
   col2.x = col2.x - o.col2.x;
   col2.y = col2.y - o.col2.y;
   col2.z = col2.z - o.col2.z;
   return this;
 }
 mat3 negate() {
   col0.x = -col0.x;
   col0.y = -col0.y;
   col0.z = -col0.z;
   col1.x = -col1.x;
   col1.y = -col1.y;
   col1.z = -col1.z;
   col2.x = -col2.x;
   col2.y = -col2.y;
   col2.z = -col2.z;
   return this;
 }
 mat3 multiply(mat3 arg) {
   final double m00 = col0.x;
   final double m01 = col1.x;
   final double m02 = col2.x;
   final double m10 = col0.y;
   final double m11 = col1.y;
   final double m12 = col2.y;
   final double m20 = col0.z;
   final double m21 = col1.z;
   final double m22 = col2.z;
   final double n00 = arg.col0.x;
   final double n01 = arg.col1.x;
   final double n02 = arg.col2.x;
   final double n10 = arg.col0.y;
   final double n11 = arg.col1.y;
   final double n12 = arg.col2.y;
   final double n20 = arg.col0.z;
   final double n21 = arg.col1.z;
   final double n22 = arg.col2.z;
   col0.x =  (m00 * n00) + (m01 * n10) + (m02 * n20);
   col1.x =  (m00 * n01) + (m01 * n11) + (m02 * n21);
   col2.x =  (m00 * n02) + (m01 * n12) + (m02 * n22);
   col0.y =  (m10 * n00) + (m11 * n10) + (m12 * n20);
   col1.y =  (m10 * n01) + (m11 * n11) + (m12 * n21);
   col2.y =  (m10 * n02) + (m11 * n12) + (m12 * n22);
   col0.z =  (m20 * n00) + (m21 * n10) + (m22 * n20);
   col1.z =  (m20 * n01) + (m21 * n11) + (m22 * n21);
   col2.z =  (m20 * n02) + (m21 * n12) + (m22 * n22);
   return this;
 }
 mat3 transposeMultiply(mat3 arg) {
   double m00 = col0.x;
   double m01 = col0.y;
   double m02 = col0.z;
   double m10 = col1.x;
   double m11 = col1.y;
   double m12 = col1.z;
   double m20 = col2.x;
   double m21 = col2.y;
   double m22 = col2.z;
   col0.x =  (m00 * arg.col0.x) + (m01 * arg.col0.y) + (m02 * arg.col0.z);
   col1.x =  (m00 * arg.col1.x) + (m01 * arg.col1.y) + (m02 * arg.col1.z);
   col2.x =  (m00 * arg.col2.x) + (m01 * arg.col2.y) + (m02 * arg.col2.z);
   col0.y =  (m10 * arg.col0.x) + (m11 * arg.col0.y) + (m12 * arg.col0.z);
   col1.y =  (m10 * arg.col1.x) + (m11 * arg.col1.y) + (m12 * arg.col1.z);
   col2.y =  (m10 * arg.col2.x) + (m11 * arg.col2.y) + (m12 * arg.col2.z);
   col0.z =  (m20 * arg.col0.x) + (m21 * arg.col0.y) + (m22 * arg.col0.z);
   col1.z =  (m20 * arg.col1.x) + (m21 * arg.col1.y) + (m22 * arg.col1.z);
   col2.z =  (m20 * arg.col2.x) + (m21 * arg.col2.y) + (m22 * arg.col2.z);
   return this;
 }
 mat3 multiplyTranspose(mat3 arg) {
   double m00 = col0.x;
   double m01 = col1.x;
   double m02 = col2.x;
   double m10 = col0.y;
   double m11 = col1.y;
   double m12 = col2.y;
   double m20 = col0.z;
   double m21 = col1.z;
   double m22 = col2.z;
   col0.x =  (m00 * arg.col0.x) + (m01 * arg.col1.x) + (m02 * arg.col2.x);
   col1.x =  (m00 * arg.col0.y) + (m01 * arg.col1.y) + (m02 * arg.col2.y);
   col2.x =  (m00 * arg.col0.z) + (m01 * arg.col1.z) + (m02 * arg.col2.z);
   col0.y =  (m10 * arg.col0.x) + (m11 * arg.col1.x) + (m12 * arg.col2.x);
   col1.y =  (m10 * arg.col0.y) + (m11 * arg.col1.y) + (m12 * arg.col2.y);
   col2.y =  (m10 * arg.col0.z) + (m11 * arg.col1.z) + (m12 * arg.col2.z);
   col0.z =  (m20 * arg.col0.x) + (m21 * arg.col1.x) + (m22 * arg.col2.x);
   col1.z =  (m20 * arg.col0.y) + (m21 * arg.col1.y) + (m22 * arg.col2.y);
   col2.z =  (m20 * arg.col0.z) + (m21 * arg.col1.z) + (m22 * arg.col2.z);
   return this;
 }
 vec3 transform(vec3 arg) {
   double x_ =  (this.col0.x * arg.x) + (this.col1.x * arg.y) + (this.col2.x * arg.z);
   double y_ =  (this.col0.y * arg.x) + (this.col1.y * arg.y) + (this.col2.y * arg.z);
   double z_ =  (this.col0.z * arg.x) + (this.col1.z * arg.y) + (this.col2.z * arg.z);
   arg.x = x_;
   arg.y = y_;
   arg.z = z_;
   return arg;
 }
 vec3 transformed(vec3 arg, [vec3 out=null]) {
   if (out == null) {
     out = new vec3.copy(arg);
   } else {
     out.copyFrom(arg);
   }
   return transform(out);
 }
 /// Copies [this] into [array] starting at [offset].
 void copyIntoArray(List&lt;num&gt; array, [int offset=0]) {
   int i = offset;
   array[i] = col0.x;
   i++;
   array[i] = col0.y;
   i++;
   array[i] = col0.z;
   i++;
   array[i] = col1.x;
   i++;
   array[i] = col1.y;
   i++;
   array[i] = col1.z;
   i++;
   array[i] = col2.x;
   i++;
   array[i] = col2.y;
   i++;
   array[i] = col2.z;
   i++;
 }
 /// Copies elements from [array] into [this] starting at [offset].
 void copyFromArray(List&lt;num&gt; array, [int offset=0]) {
   int i = offset;
   col0.x = array[i].toDouble();
   i++;
   col0.y = array[i].toDouble();
   i++;
   col0.z = array[i].toDouble();
   i++;
   col1.x = array[i].toDouble();
   i++;
   col1.y = array[i].toDouble();
   i++;
   col1.z = array[i].toDouble();
   i++;
   col2.x = array[i].toDouble();
   i++;
   col2.y = array[i].toDouble();
   i++;
   col2.z = array[i].toDouble();
   i++;
 }
 vec3 get right {
   vec3 f = new vec3.zero();
   f.x = col0.x;
   f.y = col0.y;
   f.z = col0.z;
   return f;
 }
 vec3 get up {
   vec3 f = new vec3.zero();
   f.x = col1.x;
   f.y = col1.y;
   f.z = col1.z;
   return f;
 }
 vec3 get forward {
   vec3 f = new vec3.zero();
   f.x = col2.x;
   f.y = col2.y;
   f.z = col2.z;
   return f;
 }
}
</pre>
</div>
<div>
<h3>Constructors</h3>
<div class="method"><h4 id="mat3">
<button class="show-code">Code</button>
new <strong>mat3</strong>([arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8]) <a class="anchor-link" href="#mat3"
              title="Permalink to mat3.mat3">#</a></h4>
<div class="doc">
<p>Constructs a new mat3. Supports GLSL like syntax so many possible inputs. Defaults to identity matrix.</p>
<pre class="source">
mat3([dynamic arg0, dynamic arg1, dynamic arg2, dynamic arg3, dynamic arg4, dynamic arg5, dynamic arg6, dynamic arg7, dynamic arg8]) {
 //Initialize the matrix as the identity matrix
 col0 = new vec3.zero();
 col1 = new vec3.zero();
 col2 = new vec3.zero();
 col0.x = 1.0;
 col1.y = 1.0;
 col2.z = 1.0;
 if (arg0 is num &amp;&amp; arg1 is num &amp;&amp; arg2 is num &amp;&amp; arg3 is num &amp;&amp; arg4 is num &amp;&amp; arg5 is num &amp;&amp; arg6 is num &amp;&amp; arg7 is num &amp;&amp; arg8 is num) {
   col0.x = arg0;
   col0.y = arg1;
   col0.z = arg2;
   col1.x = arg3;
   col1.y = arg4;
   col1.z = arg5;
   col2.x = arg6;
   col2.y = arg7;
   col2.z = arg8;
   return;
 }
 if (arg0 is num &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null &amp;&amp; arg4 == null &amp;&amp; arg5 == null &amp;&amp; arg6 == null &amp;&amp; arg7 == null &amp;&amp; arg8 == null) {
   col0.x = arg0;
   col1.y = arg0;
   col2.z = arg0;
   return;
 }
 if (arg0 is vec3 &amp;&amp; arg1 is vec3 &amp;&amp; arg2 is vec3) {
   col0 = arg0;
   col1 = arg1;
   col2 = arg2;
   return;
 }
 if (arg0 is mat3) {
   col0 = arg0.col0;
   col1 = arg0.col1;
   col2 = arg0.col2;
   return;
 }
 if (arg0 is mat2) {
   col0.x = arg0.col0.x;
   col0.y = arg0.col0.y;
   col1.x = arg0.col1.x;
   col1.y = arg0.col1.y;
   return;
 }
 if (arg0 is vec2 &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null &amp;&amp; arg4 == null &amp;&amp; arg5 == null &amp;&amp; arg6 == null &amp;&amp; arg7 == null &amp;&amp; arg8 == null) {
   col0.x = arg0.x;
   col1.y = arg0.y;
 }
 if (arg0 is vec3 &amp;&amp; arg1 == null &amp;&amp; arg2 == null &amp;&amp; arg3 == null &amp;&amp; arg4 == null &amp;&amp; arg5 == null &amp;&amp; arg6 == null &amp;&amp; arg7 == null &amp;&amp; arg8 == null) {
   col0.x = arg0.x;
   col1.y = arg0.y;
   col2.z = arg0.z;
 }
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat3.copy">
<button class="show-code">Code</button>
new <strong>mat3.copy</strong>(<a href="../vector_math/mat3.html">mat3</a> other) <a class="anchor-link" href="#mat3.copy"
              title="Permalink to mat3.mat3.copy">#</a></h4>
<div class="doc">
<p>Constructs a new <a class="crossref" href="../vector_math/mat3.html#mat3">mat3</a> which is a copy of 
<span class="param">other</span>.</p>
<pre class="source">
mat3.copy(mat3 other) {
 col0 = new vec3.zero();
 col1 = new vec3.zero();
 col2 = new vec3.zero();
 col0.x = other.col0.x;
 col0.y = other.col0.y;
 col0.z = other.col0.z;
 col1.x = other.col1.x;
 col1.y = other.col1.y;
 col1.z = other.col1.z;
 col2.x = other.col2.x;
 col2.y = other.col2.y;
 col2.z = other.col2.z;
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat3.identity">
<button class="show-code">Code</button>
new <strong>mat3.identity</strong>() <a class="anchor-link" href="#mat3.identity"
              title="Permalink to mat3.mat3.identity">#</a></h4>
<div class="doc">
<p>Constructs a new identity <a class="crossref" href="../vector_math/mat3.html#mat3">mat3</a>.</p>
<pre class="source">
mat3.identity() {
 col0 = new vec3.zero();
 col1 = new vec3.zero();
 col2 = new vec3.zero();
 col0.x = 1.0;
 col1.y = 1.0;
 col2.z = 1.0;
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat3.outer">
<button class="show-code">Code</button>
new <strong>mat3.outer</strong>(<a href="../vector_math/vec3.html">vec3</a> u, <a href="../vector_math/vec3.html">vec3</a> v) <a class="anchor-link" href="#mat3.outer"
              title="Permalink to mat3.mat3.outer">#</a></h4>
<div class="doc">
<p>Constructs a new <a class="crossref" href="../vector_math/mat3.html#mat3">mat3</a> from computing the outer product of 
<span class="param">u</span> and 
<span class="param">v</span>.</p>
<pre class="source">
mat3.outer(vec3 u, vec3 v) {
 col0 = new vec3.zero();
 col1 = new vec3.zero();
 col2 = new vec3.zero();
 col0.x = u.x * v.x;
 col0.y = u.x * v.y;
 col0.z = u.x * v.z;
 col1.x = u.y * v.x;
 col1.y = u.y * v.y;
 col1.z = u.y * v.z;
 col2.x = u.z * v.x;
 col2.y = u.z * v.y;
 col2.z = u.z * v.z;
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat3.raw">
<button class="show-code">Code</button>
new <strong>mat3.raw</strong>(num arg0, num arg1, num arg2, num arg3, num arg4, num arg5, num arg6, num arg7, num arg8) <a class="anchor-link" href="#mat3.raw"
              title="Permalink to mat3.mat3.raw">#</a></h4>
<div class="doc">
<pre class="source">
mat3.raw(num arg0, num arg1, num arg2, num arg3, num arg4, num arg5, num arg6, num arg7, num arg8) {
 col0 = new vec3.zero();
 col1 = new vec3.zero();
 col2 = new vec3.zero();
 col0.x = arg0;
 col0.y = arg1;
 col0.z = arg2;
 col1.x = arg3;
 col1.y = arg4;
 col1.z = arg5;
 col2.x = arg6;
 col2.y = arg7;
 col2.z = arg8;
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat3.rotationX">
<button class="show-code">Code</button>
new <strong>mat3.rotationX</strong>(num radians_) <a class="anchor-link" href="#mat3.rotationX"
              title="Permalink to mat3.mat3.rotationX">#</a></h4>
<div class="doc">
<p>/ Constructs a new <a class="crossref" href="../vector_math/mat3.html#mat3">mat3</a> representation a rotation of <a class="crossref" href="../vector_math.html#radians">radians</a> around the X axis</p>
<pre class="source">
mat3.rotationX(num radians_) {
 col0 = new vec3.zero();
 col1 = new vec3.zero();
 col2 = new vec3.zero();
 setRotationX(radians_);
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat3.rotationY">
<button class="show-code">Code</button>
new <strong>mat3.rotationY</strong>(num radians_) <a class="anchor-link" href="#mat3.rotationY"
              title="Permalink to mat3.mat3.rotationY">#</a></h4>
<div class="doc">
<p>/ Constructs a new <a class="crossref" href="../vector_math/mat3.html#mat3">mat3</a> representation a rotation of <a class="crossref" href="../vector_math.html#radians">radians</a> around the Y axis</p>
<pre class="source">
mat3.rotationY(num radians_) {
 col0 = new vec3.zero();
 col1 = new vec3.zero();
 col2 = new vec3.zero();
 setRotationY(radians_);
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat3.rotationZ">
<button class="show-code">Code</button>
new <strong>mat3.rotationZ</strong>(num radians_) <a class="anchor-link" href="#mat3.rotationZ"
              title="Permalink to mat3.mat3.rotationZ">#</a></h4>
<div class="doc">
<p>/ Constructs a new <a class="crossref" href="../vector_math/mat3.html#mat3">mat3</a> representation a rotation of <a class="crossref" href="../vector_math.html#radians">radians</a> around the Z axis</p>
<pre class="source">
mat3.rotationZ(num radians_) {
 col0 = new vec3.zero();
 col1 = new vec3.zero();
 col2 = new vec3.zero();
 setRotationZ(radians_);
}
</pre>
</div>
</div>
<div class="method"><h4 id="mat3.zero">
<button class="show-code">Code</button>
new <strong>mat3.zero</strong>() <a class="anchor-link" href="#mat3.zero"
              title="Permalink to mat3.mat3.zero">#</a></h4>
<div class="doc">
<p>Constructs a new <a class="crossref" href="../vector_math/mat3.html#mat3">mat3</a> filled with zeros.</p>
<pre class="source">
mat3.zero() {
 col0 = new vec3.zero();
 col1 = new vec3.zero();
 col2 = new vec3.zero();
 col0.x = 0.0;
 col0.y = 0.0;
 col0.z = 0.0;
 col1.x = 0.0;
 col1.y = 0.0;
 col1.z = 0.0;
 col2.x = 0.0;
 col2.y = 0.0;
 col2.z = 0.0;
}
</pre>
</div>
</div>
</div>
<div>
<h3>Properties</h3>
<div class="field"><h4 id="col0">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a>         <strong>col0</strong> <a class="anchor-link"
            href="#col0"
            title="Permalink to mat3.col0">#</a>
        </h4>
        <div class="doc">
<pre class="source">
col0
</pre>
</div>
</div>
<div class="field"><h4 id="col1">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a>         <strong>col1</strong> <a class="anchor-link"
            href="#col1"
            title="Permalink to mat3.col1">#</a>
        </h4>
        <div class="doc">
<pre class="source">
col1
</pre>
</div>
</div>
<div class="field"><h4 id="col2">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a>         <strong>col2</strong> <a class="anchor-link"
            href="#col2"
            title="Permalink to mat3.col2">#</a>
        </h4>
        <div class="doc">
<pre class="source">
col2
</pre>
</div>
</div>
<div class="field"><h4 id="cols">
<button class="show-code">Code</button>
final int         <strong>cols</strong> <a class="anchor-link"
            href="#cols"
            title="Permalink to mat3.cols">#</a>
        </h4>
        <div class="doc">
<p>Returns the number of columns in the matrix.</p>
<pre class="source">
int get cols =&gt; 3;
</pre>
</div>
</div>
<div class="field"><h4 id="forward">
<button class="show-code">Code</button>
final <a href="../vector_math/vec3.html">vec3</a>         <strong>forward</strong> <a class="anchor-link"
            href="#forward"
            title="Permalink to mat3.forward">#</a>
        </h4>
        <div class="doc">
<pre class="source">
vec3 get forward {
 vec3 f = new vec3.zero();
 f.x = col2.x;
 f.y = col2.y;
 f.z = col2.z;
 return f;
}
</pre>
</div>
</div>
<div class="field"><h4 id="length">
<button class="show-code">Code</button>
final int         <strong>length</strong> <a class="anchor-link"
            href="#length"
            title="Permalink to mat3.length">#</a>
        </h4>
        <div class="doc">
<p>Returns the number of columns in the matrix.</p>
<pre class="source">
int get length =&gt; 3;
</pre>
</div>
</div>
<div class="field"><h4 id="right">
<button class="show-code">Code</button>
final <a href="../vector_math/vec3.html">vec3</a>         <strong>right</strong> <a class="anchor-link"
            href="#right"
            title="Permalink to mat3.right">#</a>
        </h4>
        <div class="doc">
<pre class="source">
vec3 get right {
 vec3 f = new vec3.zero();
 f.x = col0.x;
 f.y = col0.y;
 f.z = col0.z;
 return f;
}
</pre>
</div>
</div>
<div class="method"><h4 id="row0">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a> <strong>get row0</strong> <a class="anchor-link" href="#row0"
              title="Permalink to mat3.get row0">#</a></h4>
<div class="doc">
<p>Returns row 0</p>
<pre class="source">
vec3 get row0 =&gt; getRow(0);
</pre>
</div>
</div>
<div class="method"><h4 id="row0=">
<button class="show-code">Code</button>
<strong>set row0</strong>(<a href="../vector_math/vec3.html">vec3</a> arg) <a class="anchor-link" href="#row0="
              title="Permalink to mat3.set row0">#</a></h4>
<div class="doc">
<p>Sets row 0 to 
<span class="param">arg</span></p>
<pre class="source">
set row0(vec3 arg) =&gt; setRow(0, arg);
</pre>
</div>
</div>
<div class="method"><h4 id="row1">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a> <strong>get row1</strong> <a class="anchor-link" href="#row1"
              title="Permalink to mat3.get row1">#</a></h4>
<div class="doc">
<p>Returns row 1</p>
<pre class="source">
vec3 get row1 =&gt; getRow(1);
</pre>
</div>
</div>
<div class="method"><h4 id="row1=">
<button class="show-code">Code</button>
<strong>set row1</strong>(<a href="../vector_math/vec3.html">vec3</a> arg) <a class="anchor-link" href="#row1="
              title="Permalink to mat3.set row1">#</a></h4>
<div class="doc">
<p>Sets row 1 to 
<span class="param">arg</span></p>
<pre class="source">
set row1(vec3 arg) =&gt; setRow(1, arg);
</pre>
</div>
</div>
<div class="method"><h4 id="row2">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a> <strong>get row2</strong> <a class="anchor-link" href="#row2"
              title="Permalink to mat3.get row2">#</a></h4>
<div class="doc">
<p>Returns row 2</p>
<pre class="source">
vec3 get row2 =&gt; getRow(2);
</pre>
</div>
</div>
<div class="method"><h4 id="row2=">
<button class="show-code">Code</button>
<strong>set row2</strong>(<a href="../vector_math/vec3.html">vec3</a> arg) <a class="anchor-link" href="#row2="
              title="Permalink to mat3.set row2">#</a></h4>
<div class="doc">
<p>Sets row 2 to 
<span class="param">arg</span></p>
<pre class="source">
set row2(vec3 arg) =&gt; setRow(2, arg);
</pre>
</div>
</div>
<div class="field"><h4 id="rows">
<button class="show-code">Code</button>
final int         <strong>rows</strong> <a class="anchor-link"
            href="#rows"
            title="Permalink to mat3.rows">#</a>
        </h4>
        <div class="doc">
<p>Returns the number of rows in the matrix.</p>
<pre class="source">
int get rows =&gt; 3;
</pre>
</div>
</div>
<div class="field"><h4 id="up">
<button class="show-code">Code</button>
final <a href="../vector_math/vec3.html">vec3</a>         <strong>up</strong> <a class="anchor-link"
            href="#up"
            title="Permalink to mat3.up">#</a>
        </h4>
        <div class="doc">
<pre class="source">
vec3 get up {
 vec3 f = new vec3.zero();
 f.x = col1.x;
 f.y = col1.y;
 f.z = col1.z;
 return f;
}
</pre>
</div>
</div>
</div>
<div>
<h3>Operators</h3>
<div class="method"><h4 id="[]">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a> <strong>operator []</strong>(int column) <a class="anchor-link" href="#[]"
              title="Permalink to mat3.operator []">#</a></h4>
<div class="doc">
<p>Gets the 
<span class="param">column</span> of the matrix</p>
<pre class="source">
vec3 operator[](int column) {
 assert(column &gt;= 0 &amp;&amp; column &lt; 3);
 switch (column) {
   case 0: return col0;
   case 1: return col1;
   case 2: return col2;
 }
 throw new ArgumentError(column);
}
</pre>
</div>
</div>
<div class="method"><h4 id="[]=">
<button class="show-code">Code</button>
void <strong>operator []=</strong>(int column, <a href="../vector_math/vec3.html">vec3</a> arg) <a class="anchor-link" href="#[]="
              title="Permalink to mat3.operator []=">#</a></h4>
<div class="doc">
<p>Assigns the 
<span class="param">column</span> of the matrix 
<span class="param">arg</span></p>
<pre class="source">
void operator[]=(int column, vec3 arg) {
 assert(column &gt;= 0 &amp;&amp; column &lt; 3);
 switch (column) {
   case 0: col0 = arg; break;
   case 1: col1 = arg; break;
   case 2: col2 = arg; break;
 }
 throw new ArgumentError(column);
}
</pre>
</div>
</div>
<div class="method"><h4 id="+">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>operator +</strong>(<a href="../vector_math/mat3.html">mat3</a> arg) <a class="anchor-link" href="#+"
              title="Permalink to mat3.operator +">#</a></h4>
<div class="doc">
<p>Returns new matrix after component wise <code>this</code> + 
<span class="param">arg</span></p>
<pre class="source">
mat3 operator+(mat3 arg) {
 mat3 r = new mat3.zero();
 r.col0.x = col0.x + arg.col0.x;
 r.col0.y = col0.y + arg.col0.y;
 r.col0.z = col0.z + arg.col0.z;
 r.col1.x = col1.x + arg.col1.x;
 r.col1.y = col1.y + arg.col1.y;
 r.col1.z = col1.z + arg.col1.z;
 r.col2.x = col2.x + arg.col2.x;
 r.col2.y = col2.y + arg.col2.y;
 r.col2.z = col2.z + arg.col2.z;
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="unary-">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>operator -</strong>() <a class="anchor-link" href="#unary-"
              title="Permalink to mat3.operator -">#</a></h4>
<div class="doc">
<p>Returns new matrix -this</p>
<pre class="source">
mat3 operator-() {
 mat3 r = new mat3.zero();
 r[0] = -this[0];
 r[1] = -this[1];
 r[2] = -this[2];
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="-">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>operator -</strong>(<a href="../vector_math/mat3.html">mat3</a> arg) <a class="anchor-link" href="#-"
              title="Permalink to mat3.operator -">#</a></h4>
<div class="doc">
<p>Returns new matrix after component wise <code>this</code> - 
<span class="param">arg</span></p>
<pre class="source">
mat3 operator-(mat3 arg) {
 mat3 r = new mat3.zero();
 r.col0.x = col0.x - arg.col0.x;
 r.col0.y = col0.y - arg.col0.y;
 r.col0.z = col0.z - arg.col0.z;
 r.col1.x = col1.x - arg.col1.x;
 r.col1.y = col1.y - arg.col1.y;
 r.col1.z = col1.z - arg.col1.z;
 r.col2.x = col2.x - arg.col2.x;
 r.col2.y = col2.y - arg.col2.y;
 r.col2.z = col2.z - arg.col2.z;
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="*">
<button class="show-code">Code</button>
<strong>operator *</strong>(arg) <a class="anchor-link" href="#*"
              title="Permalink to mat3.operator *">#</a></h4>
<div class="doc">
<p>Returns a new vector or matrix by multiplying <code>this</code> with 
<span class="param">arg</span>.</p>
<pre class="source">
dynamic operator*(dynamic arg) {
 if (arg is num) {
   mat3 r = new mat3.zero();
   r.col0.x = col0.x * arg;
   r.col0.y = col0.y * arg;
   r.col0.z = col0.z * arg;
   r.col1.x = col1.x * arg;
   r.col1.y = col1.y * arg;
   r.col1.z = col1.z * arg;
   r.col2.x = col2.x * arg;
   r.col2.y = col2.y * arg;
   r.col2.z = col2.z * arg;
   return r;
 }
 if (arg is vec3) {
   vec3 r = new vec3.zero();
   r.x =  (this.col0.x * arg.x) + (this.col1.x * arg.y) + (this.col2.x * arg.z);
   r.y =  (this.col0.y * arg.x) + (this.col1.y * arg.y) + (this.col2.y * arg.z);
   r.z =  (this.col0.z * arg.x) + (this.col1.z * arg.y) + (this.col2.z * arg.z);
   return r;
 }
 if (3 == arg.rows) {
   dynamic r = null;
   if (arg.cols == 3) {
     r = new mat3.zero();
     r.col0.x =  (this.col0.x * arg.col0.x) + (this.col1.x * arg.col0.y) + (this.col2.x * arg.col0.z);
     r.col1.x =  (this.col0.x * arg.col1.x) + (this.col1.x * arg.col1.y) + (this.col2.x * arg.col1.z);
     r.col2.x =  (this.col0.x * arg.col2.x) + (this.col1.x * arg.col2.y) + (this.col2.x * arg.col2.z);
     r.col0.y =  (this.col0.y * arg.col0.x) + (this.col1.y * arg.col0.y) + (this.col2.y * arg.col0.z);
     r.col1.y =  (this.col0.y * arg.col1.x) + (this.col1.y * arg.col1.y) + (this.col2.y * arg.col1.z);
     r.col2.y =  (this.col0.y * arg.col2.x) + (this.col1.y * arg.col2.y) + (this.col2.y * arg.col2.z);
     r.col0.z =  (this.col0.z * arg.col0.x) + (this.col1.z * arg.col0.y) + (this.col2.z * arg.col0.z);
     r.col1.z =  (this.col0.z * arg.col1.x) + (this.col1.z * arg.col1.y) + (this.col2.z * arg.col1.z);
     r.col2.z =  (this.col0.z * arg.col2.x) + (this.col1.z * arg.col2.y) + (this.col2.z * arg.col2.z);
     return r;
   }
   return r;
 }
 throw new ArgumentError(arg);
}
</pre>
</div>
</div>
</div>
<div>
<h3>Methods</h3>
<div class="method"><h4 id="absolute">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>absolute</strong>() <a class="anchor-link" href="#absolute"
              title="Permalink to mat3.absolute">#</a></h4>
<div class="doc">
<p>Returns the component wise absolute value of this.</p>
<pre class="source">
mat3 absolute() {
 mat3 r = new mat3.zero();
 r.col0.x = col0.x.abs();
 r.col0.y = col0.y.abs();
 r.col0.z = col0.z.abs();
 r.col1.x = col1.x.abs();
 r.col1.y = col1.y.abs();
 r.col1.z = col1.z.abs();
 r.col2.x = col2.x.abs();
 r.col2.y = col2.y.abs();
 r.col2.z = col2.z.abs();
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="absoluteError">
<button class="show-code">Code</button>
double <strong>absoluteError</strong>(<a href="../vector_math/mat3.html">mat3</a> correct) <a class="anchor-link" href="#absoluteError"
              title="Permalink to mat3.absoluteError">#</a></h4>
<div class="doc">
<p>Returns absolute error between <code>this</code> and 
<span class="param">correct</span></p>
<pre class="source">
double absoluteError(mat3 correct) {
 double this_norm = infinityNorm();
 double correct_norm = correct.infinityNorm();
 double diff_norm = (this_norm - correct_norm).abs();
 return diff_norm;
}
</pre>
</div>
</div>
<div class="method"><h4 id="absoluteRotate">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a> <strong>absoluteRotate</strong>(<a href="../vector_math/vec3.html">vec3</a> arg) <a class="anchor-link" href="#absoluteRotate"
              title="Permalink to mat3.absoluteRotate">#</a></h4>
<div class="doc">
<p>Rotates 
<span class="param">arg</span> by the absolute rotation of <code>this</code>
Returns 
<span class="param">arg</span>.
Primarily used by AABB transformation code.</p>
<pre class="source">
vec3 absoluteRotate(vec3 arg) {
 double m00 = col0.x.abs();
 double m01 = col1.x.abs();
 double m02 = col2.x.abs();
 double m10 = col0.y.abs();
 double m11 = col1.y.abs();
 double m12 = col2.y.abs();
 double m20 = col0.z.abs();
 double m21 = col1.z.abs();
 double m22 = col2.z.abs();
 double x = arg.x;
 double y = arg.y;
 double z = arg.z;
 arg.x = x * m00 + y * m01 + z * m02 + 0.0 * 0.0;
 arg.y = x * m10 + y * m11 + z * m12 + 0.0 * 0.0;
 arg.z = x * m20 + y * m21 + z * m22 + 0.0 * 0.0;
 return arg;
}
</pre>
</div>
</div>
<div class="method"><h4 id="add">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>add</strong>(<a href="../vector_math/mat3.html">mat3</a> o) <a class="anchor-link" href="#add"
              title="Permalink to mat3.add">#</a></h4>
<div class="doc">
<pre class="source">
mat3 add(mat3 o) {
 col0.x = col0.x + o.col0.x;
 col0.y = col0.y + o.col0.y;
 col0.z = col0.z + o.col0.z;
 col1.x = col1.x + o.col1.x;
 col1.y = col1.y + o.col1.y;
 col1.z = col1.z + o.col1.z;
 col2.x = col2.x + o.col2.x;
 col2.y = col2.y + o.col2.y;
 col2.z = col2.z + o.col2.z;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="clone">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>clone</strong>() <a class="anchor-link" href="#clone"
              title="Permalink to mat3.clone">#</a></h4>
<div class="doc">
<pre class="source">
mat3 clone() {
 return new mat3.copy(this);
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyFrom">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>copyFrom</strong>(<a href="../vector_math/mat3.html">mat3</a> arg) <a class="anchor-link" href="#copyFrom"
              title="Permalink to mat3.copyFrom">#</a></h4>
<div class="doc">
<pre class="source">
mat3 copyFrom(mat3 arg) {
 col0.x = arg.col0.x;
 col0.y = arg.col0.y;
 col0.z = arg.col0.z;
 col1.x = arg.col1.x;
 col1.y = arg.col1.y;
 col1.z = arg.col1.z;
 col2.x = arg.col2.x;
 col2.y = arg.col2.y;
 col2.z = arg.col2.z;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyFromArray">
<button class="show-code">Code</button>
void <strong>copyFromArray</strong>(List&lt;num&gt; array, [int offset = 0]) <a class="anchor-link" href="#copyFromArray"
              title="Permalink to mat3.copyFromArray">#</a></h4>
<div class="doc">
<p>Copies elements from 
<span class="param">array</span> into <code>this</code> starting at 
<span class="param">offset</span>.</p>
<pre class="source">
void copyFromArray(List&lt;num&gt; array, [int offset=0]) {
 int i = offset;
 col0.x = array[i].toDouble();
 i++;
 col0.y = array[i].toDouble();
 i++;
 col0.z = array[i].toDouble();
 i++;
 col1.x = array[i].toDouble();
 i++;
 col1.y = array[i].toDouble();
 i++;
 col1.z = array[i].toDouble();
 i++;
 col2.x = array[i].toDouble();
 i++;
 col2.y = array[i].toDouble();
 i++;
 col2.z = array[i].toDouble();
 i++;
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyInto">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>copyInto</strong>(<a href="../vector_math/mat3.html">mat3</a> arg) <a class="anchor-link" href="#copyInto"
              title="Permalink to mat3.copyInto">#</a></h4>
<div class="doc">
<pre class="source">
mat3 copyInto(mat3 arg) {
 arg.col0.x = col0.x;
 arg.col0.y = col0.y;
 arg.col0.z = col0.z;
 arg.col1.x = col1.x;
 arg.col1.y = col1.y;
 arg.col1.z = col1.z;
 arg.col2.x = col2.x;
 arg.col2.y = col2.y;
 arg.col2.z = col2.z;
 return arg;
}
</pre>
</div>
</div>
<div class="method"><h4 id="copyIntoArray">
<button class="show-code">Code</button>
void <strong>copyIntoArray</strong>(List&lt;num&gt; array, [int offset = 0]) <a class="anchor-link" href="#copyIntoArray"
              title="Permalink to mat3.copyIntoArray">#</a></h4>
<div class="doc">
<p>Copies <code>this</code> into 
<span class="param">array</span> starting at 
<span class="param">offset</span>.</p>
<pre class="source">
void copyIntoArray(List&lt;num&gt; array, [int offset=0]) {
 int i = offset;
 array[i] = col0.x;
 i++;
 array[i] = col0.y;
 i++;
 array[i] = col0.z;
 i++;
 array[i] = col1.x;
 i++;
 array[i] = col1.y;
 i++;
 array[i] = col1.z;
 i++;
 array[i] = col2.x;
 i++;
 array[i] = col2.y;
 i++;
 array[i] = col2.z;
 i++;
}
</pre>
</div>
</div>
<div class="method"><h4 id="determinant">
<button class="show-code">Code</button>
double <strong>determinant</strong>() <a class="anchor-link" href="#determinant"
              title="Permalink to mat3.determinant">#</a></h4>
<div class="doc">
<p>Returns the determinant of this matrix.</p>
<pre class="source">
double determinant() {
 double x = col0.x*((col1.y*col2.z)-(col1.z*col2.y));
 double y = col0.y*((col1.x*col2.z)-(col1.z*col2.x));
 double z = col0.z*((col1.x*col2.y)-(col1.y*col2.x));
 return x - y + z;
}
</pre>
</div>
</div>
<div class="method"><h4 id="getColumn">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a> <strong>getColumn</strong>(int column) <a class="anchor-link" href="#getColumn"
              title="Permalink to mat3.getColumn">#</a></h4>
<div class="doc">
<p>Gets the 
<span class="param">column</span> of the matrix</p>
<pre class="source">
vec3 getColumn(int column) {
 assert(column &gt;= 0 &amp;&amp; column &lt; 3);
 return new vec3.copy(this[column]);
}
</pre>
</div>
</div>
<div class="method"><h4 id="getRow">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a> <strong>getRow</strong>(int row) <a class="anchor-link" href="#getRow"
              title="Permalink to mat3.getRow">#</a></h4>
<div class="doc">
<p>Gets the 
<span class="param">row</span> of the matrix</p>
<pre class="source">
vec3 getRow(int row) {
 assert(row &gt;= 0 &amp;&amp; row &lt; 3);
 vec3 r = new vec3.zero();
 r.x = col0[row];
 r.y = col1[row];
 r.z = col2[row];
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="infinityNorm">
<button class="show-code">Code</button>
double <strong>infinityNorm</strong>() <a class="anchor-link" href="#infinityNorm"
              title="Permalink to mat3.infinityNorm">#</a></h4>
<div class="doc">
<p>Returns infinity norm of the matrix. Used for numerical analysis.</p>
<pre class="source">
double infinityNorm() {
 double norm = 0.0;
 {
   double row_norm = 0.0;
   row_norm += this[0][0].abs();
   row_norm += this[0][1].abs();
   row_norm += this[0][2].abs();
   norm = row_norm &gt; norm ? row_norm : norm;
 }
 {
   double row_norm = 0.0;
   row_norm += this[1][0].abs();
   row_norm += this[1][1].abs();
   row_norm += this[1][2].abs();
   norm = row_norm &gt; norm ? row_norm : norm;
 }
 {
   double row_norm = 0.0;
   row_norm += this[2][0].abs();
   row_norm += this[2][1].abs();
   row_norm += this[2][2].abs();
   norm = row_norm &gt; norm ? row_norm : norm;
 }
 return norm;
}
</pre>
</div>
</div>
<div class="method"><h4 id="invert">
<button class="show-code">Code</button>
double <strong>invert</strong>() <a class="anchor-link" href="#invert"
              title="Permalink to mat3.invert">#</a></h4>
<div class="doc">
<p>Invert the matrix. Returns the determinant.</p>
<pre class="source">
double invert() {
 double det = determinant();
 if (det == 0.0) {
   return 0.0;
 }
 double invDet = 1.0 / det;
 vec3 i = new vec3.zero();
 vec3 j = new vec3.zero();
 vec3 k = new vec3.zero();
 i.x = invDet * (col1.y * col2.z - col1.z * col2.y);
 i.y = invDet * (col0.z * col2.y - col0.y * col2.z);
 i.z = invDet * (col0.y * col1.z - col0.z * col1.y);
 j.x = invDet * (col1.z * col2.x - col1.x * col2.z);
 j.y = invDet * (col0.x * col2.z - col0.z * col2.x);
 j.z = invDet * (col0.z * col1.x - col0.x * col1.z);
 k.x = invDet * (col1.x * col2.y - col1.y * col2.x);
 k.y = invDet * (col0.y * col2.x - col0.x * col2.y);
 k.z = invDet * (col0.x * col1.y - col0.y * col1.x);
 col0 = i;
 col1 = j;
 col2 = k;
 return det;
}
</pre>
</div>
</div>
<div class="method"><h4 id="multiply">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>multiply</strong>(<a href="../vector_math/mat3.html">mat3</a> arg) <a class="anchor-link" href="#multiply"
              title="Permalink to mat3.multiply">#</a></h4>
<div class="doc">
<pre class="source">
mat3 multiply(mat3 arg) {
 final double m00 = col0.x;
 final double m01 = col1.x;
 final double m02 = col2.x;
 final double m10 = col0.y;
 final double m11 = col1.y;
 final double m12 = col2.y;
 final double m20 = col0.z;
 final double m21 = col1.z;
 final double m22 = col2.z;
 final double n00 = arg.col0.x;
 final double n01 = arg.col1.x;
 final double n02 = arg.col2.x;
 final double n10 = arg.col0.y;
 final double n11 = arg.col1.y;
 final double n12 = arg.col2.y;
 final double n20 = arg.col0.z;
 final double n21 = arg.col1.z;
 final double n22 = arg.col2.z;
 col0.x =  (m00 * n00) + (m01 * n10) + (m02 * n20);
 col1.x =  (m00 * n01) + (m01 * n11) + (m02 * n21);
 col2.x =  (m00 * n02) + (m01 * n12) + (m02 * n22);
 col0.y =  (m10 * n00) + (m11 * n10) + (m12 * n20);
 col1.y =  (m10 * n01) + (m11 * n11) + (m12 * n21);
 col2.y =  (m10 * n02) + (m11 * n12) + (m12 * n22);
 col0.z =  (m20 * n00) + (m21 * n10) + (m22 * n20);
 col1.z =  (m20 * n01) + (m21 * n11) + (m22 * n21);
 col2.z =  (m20 * n02) + (m21 * n12) + (m22 * n22);
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="multiplyTranspose">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>multiplyTranspose</strong>(<a href="../vector_math/mat3.html">mat3</a> arg) <a class="anchor-link" href="#multiplyTranspose"
              title="Permalink to mat3.multiplyTranspose">#</a></h4>
<div class="doc">
<pre class="source">
mat3 multiplyTranspose(mat3 arg) {
 double m00 = col0.x;
 double m01 = col1.x;
 double m02 = col2.x;
 double m10 = col0.y;
 double m11 = col1.y;
 double m12 = col2.y;
 double m20 = col0.z;
 double m21 = col1.z;
 double m22 = col2.z;
 col0.x =  (m00 * arg.col0.x) + (m01 * arg.col1.x) + (m02 * arg.col2.x);
 col1.x =  (m00 * arg.col0.y) + (m01 * arg.col1.y) + (m02 * arg.col2.y);
 col2.x =  (m00 * arg.col0.z) + (m01 * arg.col1.z) + (m02 * arg.col2.z);
 col0.y =  (m10 * arg.col0.x) + (m11 * arg.col1.x) + (m12 * arg.col2.x);
 col1.y =  (m10 * arg.col0.y) + (m11 * arg.col1.y) + (m12 * arg.col2.y);
 col2.y =  (m10 * arg.col0.z) + (m11 * arg.col1.z) + (m12 * arg.col2.z);
 col0.z =  (m20 * arg.col0.x) + (m21 * arg.col1.x) + (m22 * arg.col2.x);
 col1.z =  (m20 * arg.col0.y) + (m21 * arg.col1.y) + (m22 * arg.col2.y);
 col2.z =  (m20 * arg.col0.z) + (m21 * arg.col1.z) + (m22 * arg.col2.z);
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="negate">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>negate</strong>() <a class="anchor-link" href="#negate"
              title="Permalink to mat3.negate">#</a></h4>
<div class="doc">
<pre class="source">
mat3 negate() {
 col0.x = -col0.x;
 col0.y = -col0.y;
 col0.z = -col0.z;
 col1.x = -col1.x;
 col1.y = -col1.y;
 col1.z = -col1.z;
 col2.x = -col2.x;
 col2.y = -col2.y;
 col2.z = -col2.z;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="relativeError">
<button class="show-code">Code</button>
double <strong>relativeError</strong>(<a href="../vector_math/mat3.html">mat3</a> correct) <a class="anchor-link" href="#relativeError"
              title="Permalink to mat3.relativeError">#</a></h4>
<div class="doc">
<p>Returns relative error between <code>this</code> and 
<span class="param">correct</span></p>
<pre class="source">
double relativeError(mat3 correct) {
 mat3 diff = correct - this;
 double correct_norm = correct.infinityNorm();
 double diff_norm = diff.infinityNorm();
 return diff_norm/correct_norm;
}
</pre>
</div>
</div>
<div class="method"><h4 id="scaleAdjoint">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>scaleAdjoint</strong>(num scale) <a class="anchor-link" href="#scaleAdjoint"
              title="Permalink to mat3.scaleAdjoint">#</a></h4>
<div class="doc">
<p>Converts into Adjugate matrix and scales by 
<span class="param">scale</span></p>
<pre class="source">
mat3 scaleAdjoint(num scale) {
 double scale_ = scale.toDouble();
 double m00 = col0.x;
 double m01 = col1.x;
 double m02 = col2.x;
 double m10 = col0.y;
 double m11 = col1.y;
 double m12 = col2.y;
 double m20 = col0.z;
 double m21 = col1.z;
 double m22 = col2.z;
 col0.x = (m11 * m22 - m12 * m21) * scale_;
 col0.y = (m12 * m20 - m10 * m22) * scale_;
 col0.z = (m10 * m21 - m11 * m20) * scale_;
 col1.x = (m02 * m21 - m01 * m22) * scale_;
 col1.y = (m00 * m22 - m02 * m20) * scale_;
 col1.z = (m01 * m20 - m00 * m21) * scale_;
 col2.x = (m01 * m12 - m02 * m11) * scale_;
 col2.y = (m02 * m10 - m00 * m12) * scale_;
 col2.z = (m00 * m11 - m01 * m10) * scale_;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setColumn">
<button class="show-code">Code</button>
void <strong>setColumn</strong>(int column, <a href="../vector_math/vec3.html">vec3</a> arg) <a class="anchor-link" href="#setColumn"
              title="Permalink to mat3.setColumn">#</a></h4>
<div class="doc">
<p>Assigns the 
<span class="param">column</span> of the matrix 
<span class="param">arg</span></p>
<pre class="source">
void setColumn(int column, vec3 arg) {
 assert(column &gt;= 0 &amp;&amp; column &lt; 3);
 this[column] = arg;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setIdentity">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>setIdentity</strong>() <a class="anchor-link" href="#setIdentity"
              title="Permalink to mat3.setIdentity">#</a></h4>
<div class="doc">
<p>Makes <code>this</code> into the identity matrix.</p>
<pre class="source">
mat3 setIdentity() {
 col0.x = 1.0;
 col0.y = 0.0;
 col0.z = 0.0;
 col1.x = 0.0;
 col1.y = 1.0;
 col1.z = 0.0;
 col2.x = 0.0;
 col2.y = 0.0;
 col2.z = 1.0;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setRotationX">
<button class="show-code">Code</button>
void <strong>setRotationX</strong>(num radians) <a class="anchor-link" href="#setRotationX"
              title="Permalink to mat3.setRotationX">#</a></h4>
<div class="doc">
<p>Turns the matrix into a rotation of 
<span class="param">radians</span> around X</p>
<pre class="source">
void setRotationX(num radians) {
 double radians_ = radians.toDouble();
 double c = Math.cos(radians_);
 double s = Math.sin(radians_);
 col0.x = 1.0;
 col0.y = 0.0;
 col0.z = 0.0;
 col1.x = 0.0;
 col1.y = c;
 col1.z = s;
 col2.x = 0.0;
 col2.y = -s;
 col2.z = c;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setRotationY">
<button class="show-code">Code</button>
void <strong>setRotationY</strong>(num radians) <a class="anchor-link" href="#setRotationY"
              title="Permalink to mat3.setRotationY">#</a></h4>
<div class="doc">
<p>Turns the matrix into a rotation of 
<span class="param">radians</span> around Y</p>
<pre class="source">
void setRotationY(num radians) {
 double radians_ = radians.toDouble();
 double c = Math.cos(radians_);
 double s = Math.sin(radians_);
 col0.x = c;
 col0.y = 0.0;
 col0.z = s;
 col1.x = 0.0;
 col1.y = 1.0;
 col1.z = 0.0;
 col2.x = -s;
 col2.y = 0.0;
 col2.z = c;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setRotationZ">
<button class="show-code">Code</button>
void <strong>setRotationZ</strong>(num radians) <a class="anchor-link" href="#setRotationZ"
              title="Permalink to mat3.setRotationZ">#</a></h4>
<div class="doc">
<p>Turns the matrix into a rotation of 
<span class="param">radians</span> around Z</p>
<pre class="source">
void setRotationZ(num radians) {
 double radians_ = radians.toDouble();
 double c = Math.cos(radians_);
 double s = Math.sin(radians_);
 col0.x = c;
 col0.y = s;
 col0.z = 0.0;
 col1.x = -s;
 col1.y = c;
 col1.z = 0.0;
 col2.x = 0.0;
 col2.y = 0.0;
 col2.z = 1.0;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setRow">
<button class="show-code">Code</button>
void <strong>setRow</strong>(int row, <a href="../vector_math/vec3.html">vec3</a> arg) <a class="anchor-link" href="#setRow"
              title="Permalink to mat3.setRow">#</a></h4>
<div class="doc">
<p>Assigns the <code>column</code> of the matrix 
<span class="param">arg</span></p>
<pre class="source">
void setRow(int row, vec3 arg) {
 assert(row &gt;= 0 &amp;&amp; row &lt; 3);
 col0[row] = arg.x;
 col1[row] = arg.y;
 col2[row] = arg.z;
}
</pre>
</div>
</div>
<div class="method"><h4 id="setZero">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>setZero</strong>() <a class="anchor-link" href="#setZero"
              title="Permalink to mat3.setZero">#</a></h4>
<div class="doc">
<p>Zeros <code>this</code>.</p>
<pre class="source">
mat3 setZero() {
 col0.x = 0.0;
 col0.y = 0.0;
 col0.z = 0.0;
 col1.x = 0.0;
 col1.y = 0.0;
 col1.z = 0.0;
 col2.x = 0.0;
 col2.y = 0.0;
 col2.z = 0.0;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="sub">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>sub</strong>(<a href="../vector_math/mat3.html">mat3</a> o) <a class="anchor-link" href="#sub"
              title="Permalink to mat3.sub">#</a></h4>
<div class="doc">
<pre class="source">
mat3 sub(mat3 o) {
 col0.x = col0.x - o.col0.x;
 col0.y = col0.y - o.col0.y;
 col0.z = col0.z - o.col0.z;
 col1.x = col1.x - o.col1.x;
 col1.y = col1.y - o.col1.y;
 col1.z = col1.z - o.col1.z;
 col2.x = col2.x - o.col2.x;
 col2.y = col2.y - o.col2.y;
 col2.z = col2.z - o.col2.z;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="toString">
<button class="show-code">Code</button>
String <strong>toString</strong>() <a class="anchor-link" href="#toString"
              title="Permalink to mat3.toString">#</a></h4>
<div class="doc">
<p>Returns a printable string</p>
<pre class="source">
String toString() {
 String s = '';
 s = '$s[0] ${getRow(0)}\n';
 s = '$s[1] ${getRow(1)}\n';
 s = '$s[2] ${getRow(2)}\n';
 return s;
}
</pre>
</div>
</div>
<div class="method"><h4 id="trace">
<button class="show-code">Code</button>
double <strong>trace</strong>() <a class="anchor-link" href="#trace"
              title="Permalink to mat3.trace">#</a></h4>
<div class="doc">
<p>Returns the trace of the matrix. The trace of a matrix is the sum of the diagonal entries</p>
<pre class="source">
double trace() {
 double t = 0.0;
 t += col0.x;
 t += col1.y;
 t += col2.z;
 return t;
}
</pre>
</div>
</div>
<div class="method"><h4 id="transform">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a> <strong>transform</strong>(<a href="../vector_math/vec3.html">vec3</a> arg) <a class="anchor-link" href="#transform"
              title="Permalink to mat3.transform">#</a></h4>
<div class="doc">
<pre class="source">
vec3 transform(vec3 arg) {
 double x_ =  (this.col0.x * arg.x) + (this.col1.x * arg.y) + (this.col2.x * arg.z);
 double y_ =  (this.col0.y * arg.x) + (this.col1.y * arg.y) + (this.col2.y * arg.z);
 double z_ =  (this.col0.z * arg.x) + (this.col1.z * arg.y) + (this.col2.z * arg.z);
 arg.x = x_;
 arg.y = y_;
 arg.z = z_;
 return arg;
}
</pre>
</div>
</div>
<div class="method"><h4 id="transformed">
<button class="show-code">Code</button>
<a href="../vector_math/vec3.html">vec3</a> <strong>transformed</strong>(<a href="../vector_math/vec3.html">vec3</a> arg, [<a href="../vector_math/vec3.html">vec3</a> out = null]) <a class="anchor-link" href="#transformed"
              title="Permalink to mat3.transformed">#</a></h4>
<div class="doc">
<pre class="source">
vec3 transformed(vec3 arg, [vec3 out=null]) {
 if (out == null) {
   out = new vec3.copy(arg);
 } else {
   out.copyFrom(arg);
 }
 return transform(out);
}
</pre>
</div>
</div>
<div class="method"><h4 id="transpose">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>transpose</strong>() <a class="anchor-link" href="#transpose"
              title="Permalink to mat3.transpose">#</a></h4>
<div class="doc">
<pre class="source">
mat3 transpose() {
 double temp;
 temp = col1.x;
 col1.x = col0.y;
 col0.y = temp;
 temp = col2.x;
 col2.x = col0.z;
 col0.z = temp;
 temp = col2.y;
 col2.y = col1.z;
 col1.z = temp;
 return this;
}
</pre>
</div>
</div>
<div class="method"><h4 id="transposed">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>transposed</strong>() <a class="anchor-link" href="#transposed"
              title="Permalink to mat3.transposed">#</a></h4>
<div class="doc">
<p>Returns the tranpose of this.</p>
<pre class="source">
mat3 transposed() {
 mat3 r = new mat3.zero();
 r.col0.x = col0.x;
 r.col0.y = col1.x;
 r.col0.z = col2.x;
 r.col1.x = col0.y;
 r.col1.y = col1.y;
 r.col1.z = col2.y;
 r.col2.x = col0.z;
 r.col2.y = col1.z;
 r.col2.z = col2.z;
 return r;
}
</pre>
</div>
</div>
<div class="method"><h4 id="transposeMultiply">
<button class="show-code">Code</button>
<a href="../vector_math/mat3.html">mat3</a> <strong>transposeMultiply</strong>(<a href="../vector_math/mat3.html">mat3</a> arg) <a class="anchor-link" href="#transposeMultiply"
              title="Permalink to mat3.transposeMultiply">#</a></h4>
<div class="doc">
<pre class="source">
mat3 transposeMultiply(mat3 arg) {
 double m00 = col0.x;
 double m01 = col0.y;
 double m02 = col0.z;
 double m10 = col1.x;
 double m11 = col1.y;
 double m12 = col1.z;
 double m20 = col2.x;
 double m21 = col2.y;
 double m22 = col2.z;
 col0.x =  (m00 * arg.col0.x) + (m01 * arg.col0.y) + (m02 * arg.col0.z);
 col1.x =  (m00 * arg.col1.x) + (m01 * arg.col1.y) + (m02 * arg.col1.z);
 col2.x =  (m00 * arg.col2.x) + (m01 * arg.col2.y) + (m02 * arg.col2.z);
 col0.y =  (m10 * arg.col0.x) + (m11 * arg.col0.y) + (m12 * arg.col0.z);
 col1.y =  (m10 * arg.col1.x) + (m11 * arg.col1.y) + (m12 * arg.col1.z);
 col2.y =  (m10 * arg.col2.x) + (m11 * arg.col2.y) + (m12 * arg.col2.z);
 col0.z =  (m20 * arg.col0.x) + (m21 * arg.col0.y) + (m22 * arg.col0.z);
 col1.z =  (m20 * arg.col1.x) + (m21 * arg.col1.y) + (m22 * arg.col1.z);
 col2.z =  (m20 * arg.col2.x) + (m21 * arg.col2.y) + (m22 * arg.col2.z);
 return this;
}
</pre>
</div>
</div>
</div>
        </div>
        <div class="clear"></div>
        </div>
        <div class="footer">
          
        </div>
        <script async src="../client-live-nav.js"></script>
        </body></html>
        
